From a83d3078c2487ce61509bdfcb7683d1e873abc66 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 15 Oct 2020 21:18:35 +0100 Subject: [PATCH] Allow toggling the password entry visibility programmatically We are going to need a method for toggling the visibility from the accessibility layer. --- gtk/gtkpasswordentry.c | 10 ++++++++-- gtk/gtkpasswordentryprivate.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gtk/gtkpasswordentry.c b/gtk/gtkpasswordentry.c index 8d5de422b2..8ac1cd3ade 100644 --- a/gtk/gtkpasswordentry.c +++ b/gtk/gtkpasswordentry.c @@ -135,8 +135,14 @@ focus_changed (GtkWidget *widget) if (entry->keyboard) caps_lock_state_changed (entry->keyboard, NULL, widget); } - -static void + +/*< private > + * gtk_password_entry_toggle_peek: + * @entry: a #GtkPasswordEntry + * + * Toggles the text visibility. + */ +void gtk_password_entry_toggle_peek (GtkPasswordEntry *entry) { gboolean visibility; diff --git a/gtk/gtkpasswordentryprivate.h b/gtk/gtkpasswordentryprivate.h index 2daaaba4fb..ad86f4e020 100644 --- a/gtk/gtkpasswordentryprivate.h +++ b/gtk/gtkpasswordentryprivate.h @@ -27,4 +27,6 @@ G_BEGIN_DECLS GtkText * gtk_password_entry_get_text_widget (GtkPasswordEntry *entry); +void gtk_password_entry_toggle_peek (GtkPasswordEntry *entry); + G_END_DECLS -- 2.30.2